﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System
{
    public class ZConfig
    {
        public static string ReadAppSettings(string configKeyName)
        {
            return System.Configuration.ConfigurationManager.AppSettings[configKeyName];
        }

        public static string ResourcesDir { get { return ReadAppSettings("ResourcesDir"); } }
        public static string PreviewUrl { get { return ReadAppSettings("PreviewUrl"); } }

        public static Int32 SleepTimes { get { return Convert.ToInt32(ReadAppSettings("SleepTimes")); } }

        public static Int32 CacheTime
        {
            get
            {
                if (!string.IsNullOrEmpty(ReadAppSettings("CacheTime")))
                {
                    return Convert.ToInt32(ReadAppSettings("CacheTime"));
                }
                else
                    return 60;
            }
        }
        public static String GroupServer { get { return ReadAppSettings("GroupServer"); } }
        public static Boolean IsUseCache { get { return Convert.ToBoolean(ReadAppSettings("IsUseCache")); } }
        public static Boolean IFUseLanguage { get { return Convert.ToBoolean(ReadAppSettings("IFUseLanguage")); } }
        public static Boolean IFUseRights { get { return Convert.ToBoolean(ReadAppSettings("IFUseRights")); } }
        public static Boolean IFLogError { get { return Convert.ToBoolean(ReadAppSettings("IFLogError")); } }
        public static Boolean IsUseImageHost { get { return Convert.ToBoolean(ReadAppSettings("IsUseImageHost")); } }
        public static Boolean IsUseWebSet { get { return Convert.ToBoolean(ReadAppSettings("IsUseWebSet")); } }
        public static int TemplateLayer { get { return Convert.ToInt32(ReadAppSettings("TemplateLayer")); } }

    }
}
